package com.nanhai.buddhist.college.framework.mybatis.core.util;

import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.date.format.FastDateFormat;
import cn.hutool.core.util.RandomUtil;
import org.apache.commons.lang3.RandomStringUtils;
import org.apache.commons.lang3.StringUtils;

import java.util.Calendar;
import java.util.Date;
import java.util.HashSet;

/**
 * @author AKai
 * @date 2022/8/14
 */
public class IdGenerateUtil {


    private static int RAND_LENGTH = 13;


    public static String getId(String prefix) {
        StringBuffer stringBuffer = new StringBuffer();
        stringBuffer.append(prefix);
        stringBuffer.append(getDateString());
        stringBuffer.append(RandomUtil.randomNumbers(RAND_LENGTH));
        return stringBuffer.toString();
    }



    private static String getDateString() {
        return DatePattern.PURE_DATETIME_FORMAT.format(new Date());

    }


}
